<?php $website_url = Configure::read('Website.url'); 
	//pr($subcats);
	//exit;
?>
<div id="content">
  <div class="cate_top"> HOME<a href="#">&raquo;Cloths</a> </div>
  <div class="middle_left"><!-- Element Left side--><?php echo $this->element('home_LeftSideBar'); ?></div>
  <div class="middle_right">
    <div class="middle_r1">
    
    <?php
		if(isset($subcats) and ($subcats) )
		{
	?>
              <div class="cat_listing_block">
                <h1> 
		        <?php echo $html->link($catgory['Category']['name'], 
				array('controller'=>'categories', 'action'=>'subcategories', $catgory['Category']['slug'])); ?>
                </h1>
                <div class="cloth_down">
                <?php
					$i =1;
					foreach($subcats as $subcat)
						{
							if($i<5)
							{
				?>
                          <div class="sel_cat_main">
                            <ul>
                              <li>
                                <?php
								if(isset($subcat['Category']['img']) and ($subcat['Category']['img'])) 
								{
									echo $html->link($html->image("Category/".$subcat['Category']['img'], array('height'=>'', 'width'=>'')), 
							        array('controller'=>'products', 'action'=>'index', $subcat['Category']['slug']), array('escape'=>false));
								} ?>
                              </li>
                              <li><b>
                               <?php echo $html->link($subcat['Category']['name'], 
							   array('controller'=>'products', 'action'=>'index', $subcat['Category']['slug'])); ?>
                                 </b>
                              </li>
                              <?php
							 
							  	if(isset($subcat['Category']['subcategories']) and ($subcat['Category']['subcategories']))
								{
							  		// pr($subcat['Category']['subcategories']);
							  ?>
                              <li>
                                <ul>
                                <?php
								foreach( $subcat['Category']['subcategories'] as $Subsubcats)
									{
										
									?>
									  <li> <?php echo $html->link($Subsubcats['Category']['name'], 
							   array('controller'=>'products', 'action'=>'index', $Subsubcats['Category']['slug'])); ?></li>
									 <?php
									}
								 ?>
                                </ul>
                              </li>
                              <?php
								}
							  ?>
                            </ul>
                          </div>
				  <?php
							}
							$i++;
					 }
                  ?>
                </div>
              </div>
         <div class="cat_listing_block">
           <h1> <a class="maincatlink" href="/MarketPlace/products/apparel-1">Categories in <?php echo $catgory['Category']['name']; ?></a> </h1>
           <div class="cloth_down">
                <?php
					$t=0;
					foreach($subcats as $subcat)
						{
							//pr($subcat);
				?>
                			
                                <div class="sel_cat_main">
                                <ul>
                                  <li>
                                  		<b>
											  <?php echo $html->link($subcat['Category']['name'], 
                                            array('controller'=>'products', 'action'=>'index', $subcat['Category']['slug'])); ?>
                                  		</b>
                                  </li>
                                  <?php
							  	if(isset($subcat['Category']['subcategories']) and ($subcat['Category']['subcategories']))
								{
							  		
							  ?>
                              <li>
                                <ul>
                                <?php
								foreach($subcat['Category']['subcategories'] as $subcats)
									{
									?>
									  <li> <?php echo $html->link($subcats['Category']['name'], 
							                     array('controller'=>'products', 'action'=>'index', $subcats['Category']['slug'])); ?></li>
									 <?php
									}
								 ?>
                                </ul>
                              </li>
                              <?php
								}
							  ?>
                                </ul>
                              </div>
				  <?php
							$t++;
					 }
                  ?>

          </div>
      </div>
      <?php
		   }
	  ?>
    </div>
    <div class="clear"></div>
  </div>
</div>
<div class="clear"></div>
<div class="main_mt"> 
    <!--  home_aboutus--> 
    <?php echo $this->element('home_abouts'); ?> 
</div>
